var color = {
	'GRAY':119,
	'list':['#ef4444', '#faa31b','#fff000', '#82c341','#009f75',
	        '#88c6ed','#394ba0', '#d54799', '#999999', '#ffff00', '#006666'],
	'i':0,
	'map':[],
	'assign': function(key){
		var i = this.i%this.list.length;
		this.map[key]=this.list[i];
		this.i++;
		return this.map[key];
	},
	'toGray': function(color){
		var rgb=[parseInt(color.substring(1,3),16),parseInt(color.substring(3,5),16), parseInt(color.substring(5,7),16)];
		var ret = "#"
		for (var i=0; i<rgb.length; i++){
			var colInt=4096+Math.floor(rgb[i] - (rgb[i]-this.GRAY)/1.5);
			ret+=colInt.toString(16).substring(2);
		}
		return ret;

	},
	'lighten': function(color){
		var rgb=[parseInt(color.substring(1,3),16), 
		         parseInt(color.substring(3,5),16), 
		         parseInt(color.substring(5,7),16)];
		var ret = "#";
		for (var i = 0; i<rgb.length; i++){
			rgb[i] +=70; 
			if (rgb[i]>255) rgb[i]=255;
			ret += rgb[i].toString(16);
		}
		return ret;
		
	},
	'toRgb': function(color){
		return [parseInt(color.substring(1,3),16),parseInt(color.substring(3,5),16), parseInt(color.substring(5,7),16)];
	},
	'rgba': function(color, trans){
		return 'rgba('+this.toRgb(color)[0]+","+this.toRgb(color)[1]+","+this.toRgb(color)[2]+","+trans+")";
	}
	
};